#coding=utf-8
from django.shortcuts import render
from booktest.models import *
from django.db.models import F,Q
# Create your views here.

def index(request):
    # list=BookInfo.bookmanager.filter(bread__gte=10) 
    # list=BookInfo.bookmanager.filter(bread__gte=F('bcommet')*2)
    list=BookInfo.bookmanager.filter(Q(pk__lt=6)| Q(bcommet__gt=10))
    context={'aa':list}
    return render(request,'booktest/index.html',context)

def getTest1(request):
    return render(request,'booktest/getTest1.html')

def getTest2(request):
    a=request.GET['a']
    b=request.GET['b']
    context={'a':a,'b':b}
    return render(request,'booktest/getTest2.html',context)

def getTest3(request):
    a=request.GET.getlist('a')
    b=request.GET['b']
    context={'a':a,'b':b}
    return render(request,'booktest/getTest3.html',context)